package pers.cj.pdos.entity;

import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 核销单编号，商品编号，借出单，进货订单编号，商品模板，入库单编号，销售订单编号，销售编号,调拨单,商品套餐,借出归还单
 * </p>
 * 当单号规则，超过最大限制时，则位数失效，直接用真实当前值。
 * @author chenj
 * @since 2019-11-06
 */
public class OrderRule extends Model<OrderRule> {

    private static final long serialVersionUID = 1L;

    private String id;

    /**
     * 编号类型
            1核销单编号
            2商品编号
            3借出单
            4进货订单编号
            5商品模板
            6入库单编号
            7销售订单编号
            8销售编号
            9调拨单
            10商品套餐
            11借出归还单
     */
    private Integer type;

    /**
     * 编号前缀
     */
    private String prefix;

    /**
     * 编号位数
     */
    private Integer num;

    /**
     * 当前编号
     */
    private Integer current;

    private Date time;

    /**
     * 所属公司
     */
    private String companyId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }
    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }
    public Integer getCurrent() {
        return current;
    }

    public void setCurrent(Integer current) {
        this.current = current;
    }
    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }
    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "OrderRule{" +
            "id=" + id +
            ", type=" + type +
            ", prefix=" + prefix +
            ", num=" + num +
            ", current=" + current +
            ", time=" + time +
            ", companyId=" + companyId +
        "}";
    }
}
